#!/usr/bin/python

import sys

tab_file = sys.argv[1]
tf = open(tab_file, "rU")
lines = tf.readlines()


print "<featureSlot showShading=\"false\" strand=\"reverse\">"

for line in lines:
    l = line.split('\t')
    feat = l[0]
    note = l[1]
    bound_moiety = l[2]
    locus_tag = l[1]
    start = l[2]
    stop = l[3]
    frame = l[4]
    gene = l[7]
    cog = l[8]
    desc = l[9].rstrip()
    if feat == "tRNA":
        print "<feature color=\"rgb(153,0,0)\" decoration=\"arc\" opacity=\"1.0\">" + "\n" \
            "<featureRange start=\"" + start + "\" stop=\"" + stop + "\" />" + "\n" \
            "</feature>"
    elif feat == "rRNA":
        print "<feature color=\"rgb(153,0,153)\" decoration=\"arc\" opacity=\"1.0\">" + "\n" \
            "<featureRange start=\"" + start + "\" stop=\"" + stop + "\" />" + "\n" \
            "</feature>"
print "</featureSlot>"
tf.close()
